<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('项目成员工时列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>成员ID：</label>
                                <input type="text" name="peopleId"/>
                            </li>
                            <li>
                                <label>任务名称：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>时间类型：</label>
                                <input type="text" name="sjlx"/>
                            </li>
                            <li>
                                <label>工时：</label>
                                <input type="text" name="count"/>
                            </li>
                            <li>
                                <label>审批人：</label>
                                <input type="text" name="spr"/>
                            </li>
                            <li>
                                <label>审批时间：</label>
                                <input type="text" class="time-input" placeholder="请选择审批时间" name="sprAt"/>
                            </li>
                            <li>
                                <label>开始：</label>
                                <input type="text" class="time-input" placeholder="请选择开始" name="startAt"/>
                            </li>
                            <li>
                                <label>结束：</label>
                                <input type="text" class="time-input" placeholder="请选择结束" name="endAt"/>
                            </li>
                            <li>
                                <label>状态：</label>
                                <select name="status" th:with="type=${@dict.getType('${dictType}')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>删除标记 0:删除 1:没删除：</label>
                                <input type="text" name="deleteFlag"/>
                            </li>
                            <li>
                                <label>创建人：</label>
                                <input type="text" name="createUser"/>
                            </li>
                            <li>
                                <label>创建时间：</label>
                                <input type="text" class="time-input" placeholder="请选择创建时间" name="createAt"/>
                            </li>
                            <li>
                                <label>修改人：</label>
                                <input type="text" name="updateUser"/>
                            </li>
                            <li>
                                <label>修改时间：</label>
                                <input type="text" class="time-input" placeholder="请选择修改时间" name="updateAt"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="gcgl:peopleline:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="gcgl:peopleline:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="gcgl:peopleline:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="gcgl:peopleline:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('gcgl:peopleline:edit')}]];
        var removeFlag = [[${@permission.hasPermi('gcgl:peopleline:remove')}]];
        var idDatas = [[${@dict.getType('${column.dictType}')}]];
        var peopleIdDatas = [[${@dict.getType('${column.dictType}')}]];
        var nameDatas = [[${@dict.getType('${column.dictType}')}]];
        var sjlxDatas = [[${@dict.getType('${column.dictType}')}]];
        var countDatas = [[${@dict.getType('${column.dictType}')}]];
        var sprDatas = [[${@dict.getType('${column.dictType}')}]];
        var sprAtDatas = [[${@dict.getType('${column.dictType}')}]];
        var startAtDatas = [[${@dict.getType('${column.dictType}')}]];
        var endAtDatas = [[${@dict.getType('${column.dictType}')}]];
        var statusDatas = [[${@dict.getType('${column.dictType}')}]];
        var descsDatas = [[${@dict.getType('${column.dictType}')}]];
        var deleteFlagDatas = [[${@dict.getType('${column.dictType}')}]];
        var createUserDatas = [[${@dict.getType('${column.dictType}')}]];
        var createAtDatas = [[${@dict.getType('${column.dictType}')}]];
        var updateUserDatas = [[${@dict.getType('${column.dictType}')}]];
        var updateAtDatas = [[${@dict.getType('${column.dictType}')}]];
        var prefix = ctx + "gcgl/peopleline";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "项目成员工时",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'peopleId',
                    title: '成员ID',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(peopleIdDatas, value);
                    }
                },
                {
                    field: 'name',
                    title: '任务名称',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(nameDatas, value);
                    }
                },
                {
                    field: 'sjlx',
                    title: '时间类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(sjlxDatas, value);
                    }
                },
                {
                    field: 'count',
                    title: '工时',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(countDatas, value);
                    }
                },
                {
                    field: 'spr',
                    title: '审批人',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(sprDatas, value);
                    }
                },
                {
                    field: 'sprAt',
                    title: '审批时间',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(sprAtDatas, value);
                    }
                },
                {
                    field: 'startAt',
                    title: '开始',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(startAtDatas, value);
                    }
                },
                {
                    field: 'endAt',
                    title: '结束',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(endAtDatas, value);
                    }
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(statusDatas, value);
                    }
                },
                {
                    field: 'descs',
                    title: '描述',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(descsDatas, value);
                    }
                },
                {
                    field: 'deleteFlag',
                    title: '删除标记 0:删除 1:没删除',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(deleteFlagDatas, value);
                    }
                },
                {
                    field: 'createUser',
                    title: '创建人',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(createUserDatas, value);
                    }
                },
                {
                    field: 'createAt',
                    title: '创建时间',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(createAtDatas, value);
                    }
                },
                {
                    field: 'updateUser',
                    title: '修改人',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(updateUserDatas, value);
                    }
                },
                {
                    field: 'updateAt',
                    title: '修改时间',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(updateAtDatas, value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>